use rpc::{RpcChannel, RpcResult};

trait HelloService {

    fn hello(&mut self, data: i32) -> RpcResult<i32>;

    fn demo(&mut self, data: String) -> RpcResult<String>;
}

struct HelloServiceImpl;

impl HelloServiceImpl {
    fn new() -> HelloServiceImpl {
        HelloServiceImpl
    }

    fn hello(&mut self, data: i32) -> RpcResult<i32> {
        Ok(data)
    }
}

impl HelloServiceImpl {
    fn demo(&mut self, data: String) -> RpcResult<String> {
        Ok(data)
    }
}

impl HelloService for HelloServiceImpl {
    fn hello(&mut self, data: i32) -> RpcResult<i32> {
        todo!()
    }

    fn demo(&mut self, data: String) -> RpcResult<String> {
        todo!()
    }
}